package com.zzy.card;
import java.util.ArrayList;
public class CardCatalog {
	// 单例模式
    private static CardCatalog cardCatalog = null;
    private CardCatalog() {
    }
    public static CardCatalog getCatalog() {
        if (cardCatalog == null) {
            cardCatalog = new CardCatalog();
        }
        return cardCatalog;
    }
    private ArrayList<creditCard> Cardcatalog = new ArrayList<creditCard>(); // 设置一个creditcard的数组
    public ArrayList<creditCard> getCardcatalog() {
        return Cardcatalog;
    }
    public creditCard gCreditCard1(String name) {
        for (creditCard creditCard : Cardcatalog) {
            if (creditCard != null) {
                if (creditCard.getname().equals(name)) {
                    return creditCard;
                }
            }
        }
        return null;
    }
    public creditCard gCreditCard2(String cardnode) {
        for (creditCard creditCard : Cardcatalog) {
            if (creditCard != null) {
                if (creditCard.getCardnode().equals(cardnode)) {
                    return creditCard;
                }
            }
        }
        return null;
    }

}
